home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / veryea2a / writer.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-10-09  |  18.3 KB  |  582 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  4. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
  5. Begin VB.Form frmWriter 
  6.    BackColor       =   &H8000000A&
  7.    BorderStyle     =   1  'Fest Einfach
  8.    Caption         =   "Easy Writer"
  9.    ClientHeight    =   10410
  10.    ClientLeft      =   1995
  11.    ClientTop       =   330
  12.    ClientWidth     =   10995
  13.    LinkTopic       =   "Form1"
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   10410
  16.    ScaleWidth      =   10995
  17.    Begin VB.CommandButton Command21 
  18.       BackColor       =   &H00FFFFFF&
  19.       Caption         =   "Search"
  20.       BeginProperty Font 
  21.          Name            =   "Arial"
  22.          Size            =   8.25
  23.          Charset         =   0
  24.          Weight          =   700
  25.          Underline       =   0   'False
  26.          Italic          =   0   'False
  27.          Strikethrough   =   0   'False
  28.       EndProperty
  29.       Height          =   375
  30.       Left            =   9480
  31.       Style           =   1  'Grafisch
  32.       TabIndex        =   22
  33.       Top             =   2040
  34.       Width           =   1335
  35.    End
  36.    Begin VB.CommandButton Command20 
  37.       BackColor       =   &H00FFFFFF&
  38.       Caption         =   "Insert Time"
  39.       BeginProperty Font 
  40.          Name            =   "MS Sans Serif"
  41.          Size            =   8.25
  42.          Charset         =   0
  43.          Weight          =   700
  44.          Underline       =   0   'False
  45.          Italic          =   0   'False
  46.          Strikethrough   =   0   'False
  47.       EndProperty
  48.       Height          =   375
  49.       Left            =   7920
  50.       Style           =   1  'Grafisch
  51.       TabIndex        =   21
  52.       Top             =   2040
  53.       Width           =   1095
  54.    End
  55.    Begin VB.CommandButton Command19 
  56.       BackColor       =   &H00FFFFFF&
  57.       Caption         =   "Insert Date"
  58.       BeginProperty Font 
  59.          Name            =   "MS Sans Serif"
  60.          Size            =   8.25
  61.          Charset         =   0
  62.          Weight          =   700
  63.          Underline       =   0   'False
  64.          Italic          =   0   'False
  65.          Strikethrough   =   0   'False
  66.       EndProperty
  67.       Height          =   375
  68.       Left            =   7920
  69.       Style           =   1  'Grafisch
  70.       TabIndex        =   20
  71.       Top             =   1560
  72.       Width           =   1095
  73.    End
  74.    Begin VB.CommandButton Command18 
  75.       BackColor       =   &H00FFFFFF&
  76.       Caption         =   "Paste"
  77.       BeginProperty Font 
  78.          Name            =   "MS Sans Serif"
  79.          Size            =   8.25
  80.          Charset         =   0
  81.          Weight          =   700
  82.          Underline       =   0   'False
  83.          Italic          =   0   'False
  84.          Strikethrough   =   0   'False
  85.       EndProperty
  86.       Height          =   375
  87.       Left            =   120
  88.       Style           =   1  'Grafisch
  89.       TabIndex        =   19
  90.       Top             =   2040
  91.       Width           =   1095
  92.    End
  93.    Begin VB.CommandButton Command17 
  94.       BackColor       =   &H00FFFFFF&
  95.       Caption         =   "Cut"
  96.       BeginProperty Font 
  97.          Name            =   "MS Sans Serif"
  98.          Size            =   8.25
  99.          Charset         =   0
  100.          Weight          =   700
  101.          Underline       =   0   'False
  102.          Italic          =   0   'False
  103.          Strikethrough   =   0   'False
  104.       EndProperty
  105.       Height          =   375
  106.       Left            =   1320
  107.       Style           =   1  'Grafisch
  108.       TabIndex        =   18
  109.       Top             =   1560
  110.       Width           =   1095
  111.    End
  112.    Begin VB.CommandButton Command16 
  113.       BackColor       =   &H00FFFFFF&
  114.       Caption         =   "Copy"
  115.       BeginProperty Font 
  116.          Name            =   "MS Sans Serif"
  117.          Size            =   8.25
  118.          Charset         =   0
  119.          Weight          =   700
  120.          Underline       =   0   'False
  121.          Italic          =   0   'False
  122.          Strikethrough   =   0   'False
  123.       EndProperty
  124.       Height          =   375
  125.       Left            =   120
  126.       Style           =   1  'Grafisch
  127.       TabIndex        =   17
  128.       Top             =   1560
  129.       Width           =   1095
  130.    End
  131.    Begin VB.CommandButton Command15 
  132.       BackColor       =   &H00FFFFFF&
  133.       Caption         =   "Print"
  134.       BeginProperty Font 
  135.          Name            =   "MS Sans Serif"
  136.          Size            =   8.25
  137.          Charset         =   0
  138.          Weight          =   700
  139.          Underline       =   0   'False
  140.          Italic          =   0   'False
  141.          Strikethrough   =   0   'False
  142.       EndProperty
  143.       Height          =   375
  144.       Left            =   1320
  145.       Style           =   1  'Grafisch
  146.       TabIndex        =   16
  147.       Top             =   2040
  148.       Width           =   1095
  149.    End
  150.    Begin VB.CommandButton Command14 
  151.       BackColor       =   &H00FFFFFF&
  152.       Caption         =   "Save"
  153.       BeginProperty Font 
  154.          Name            =   "Arial"
  155.          Size            =   8.25
  156.          Charset         =   0
  157.          Weight          =   700
  158.          Underline       =   0   'False
  159.          Italic          =   0   'False
  160.          Strikethrough   =   0   'False
  161.       EndProperty
  162.       Height          =   375
  163.       Left            =   120
  164.       Style           =   1  'Grafisch
  165.       TabIndex        =   15
  166.       Top             =   720
  167.       Width           =   1095
  168.    End
  169.    Begin VB.CommandButton Command12 
  170.       BackColor       =   &H00FFFFFF&
  171.       Caption         =   "Open"
  172.       BeginProperty Font 
  173.          Name            =   "Arial"
  174.          Size            =   8.25
  175.          Charset         =   0
  176.          Weight          =   700
  177.          Underline       =   0   'False
  178.          Italic          =   0   'False
  179.          Strikethrough   =   0   'False
  180.       EndProperty
  181.       Height          =   375
  182.       Left            =   120
  183.       Style           =   1  'Grafisch
  184.       TabIndex        =   14
  185.       Top             =   240
  186.       Width           =   1095
  187.    End
  188.    Begin VB.CommandButton Command10 
  189.       BackColor       =   &H00FFFFFF&
  190.       Caption         =   "Exit"
  191.       BeginProperty Font 
  192.          Name            =   "Arial"
  193.          Size            =   8.25
  194.          Charset         =   0
  195.          Weight          =   700
  196.          Underline       =   0   'False
  197.          Italic          =   0   'False
  198.          Strikethrough   =   0   'False
  199.       EndProperty
  200.       Height          =   375
  201.       Left            =   1320
  202.       Style           =   1  'Grafisch
  203.       TabIndex        =   13
  204.       Top             =   720
  205.       Width           =   1095
  206.    End
  207.    Begin VB.CommandButton Command9 
  208.       BackColor       =   &H00FFFFFF&
  209.       Caption         =   "New"
  210.       BeginProperty Font 
  211.          Name            =   "Arial"
  212.          Size            =   8.25
  213.          Charset         =   0
  214.          Weight          =   700
  215.          Underline       =   0   'False
  216.          Italic          =   0   'False
  217.          Strikethrough   =   0   'False
  218.       EndProperty
  219.       Height          =   375
  220.       Left            =   1320
  221.       Style           =   1  'Grafisch
  222.       TabIndex        =   12
  223.       Top             =   240
  224.       Width           =   1095
  225.    End
  226.    Begin MSComDlg.CommonDialog CommonDialog1 
  227.       Left            =   10200
  228.       Top             =   360
  229.       _ExtentX        =   847
  230.       _ExtentY        =   847
  231.       _Version        =   393216
  232.    End
  233.    Begin MSComctlLib.Slider Slider1 
  234.       Height          =   375
  235.       Left            =   0
  236.       TabIndex        =   10
  237.       Top             =   2760
  238.       Width           =   11055
  239.       _ExtentX        =   19500
  240.       _ExtentY        =   661
  241.       _Version        =   393216
  242.    End
  243.    Begin VB.CommandButton Command8 
  244.       BackColor       =   &H00FFFFFF&
  245.       Caption         =   "Color"
  246.       BeginProperty Font 
  247.          Name            =   "Arial"
  248.          Size            =   8.25
  249.          Charset         =   0
  250.          Weight          =   700
  251.          Underline       =   0   'False
  252.          Italic          =   0   'False
  253.          Strikethrough   =   0   'False
  254.       EndProperty
  255.       Height          =   375
  256.       Left            =   3000
  257.       Style           =   1  'Grafisch
  258.       TabIndex        =   9
  259.       Top             =   2040
  260.       Width           =   1095
  261.    End
  262.    Begin VB.CommandButton Command7 
  263.       BackColor       =   &H00FFFFFF&
  264.       Caption         =   "Font"
  265.       BeginProperty Font 
  266.          Name            =   "Arial"
  267.          Size            =   8.25
  268.          Charset         =   0
  269.          Weight          =   700
  270.          Underline       =   0   'False
  271.          Italic          =   0   'False
  272.          Strikethrough   =   0   'False
  273.       EndProperty
  274.       Height          =   375
  275.       Left            =   3000
  276.       Style           =   1  'Grafisch
  277.       TabIndex        =   8
  278.       Top             =   1560
  279.       Width           =   1095
  280.    End
  281.    Begin VB.CommandButton Command6 
  282.       Height          =   375
  283.       Left            =   7080
  284.       Picture         =   "writer.frx":0000
  285.       Style           =   1  'Grafisch
  286.       TabIndex        =   7
  287.       Top             =   2040
  288.       Width           =   375
  289.    End
  290.    Begin VB.CommandButton Command5 
  291.       Height          =   375
  292.       Left            =   5160
  293.       Picture         =   "writer.frx":038E
  294.       Style           =   1  'Grafisch
  295.       TabIndex        =   6
  296.       Top             =   2040
  297.       Width           =   375
  298.    End
  299.    Begin VB.CommandButton Command4 
  300.       Height          =   375
  301.       Left            =   6120
  302.       Picture         =   "writer.frx":06EA
  303.       Style           =   1  'Grafisch
  304.       TabIndex        =   5
  305.       Top             =   2040
  306.       Width           =   375
  307.    End
  308.    Begin VB.CommandButton Command3 
  309.       Height          =   375
  310.       Left            =   5640
  311.       Picture         =   "writer.frx":0A31
  312.       Style           =   1  'Grafisch
  313.       TabIndex        =   4
  314.       Top             =   2040
  315.       Width           =   375
  316.    End
  317.    Begin VB.CommandButton Command2 
  318.       Height          =   375
  319.       Left            =   6600
  320.       Picture         =   "writer.frx":0D38
  321.       Style           =   1  'Grafisch
  322.       TabIndex        =   3
  323.       Top             =   2040
  324.       Width           =   375
  325.    End
  326.    Begin VB.CommandButton Command1 
  327.       Height          =   375
  328.       Left            =   4680
  329.       Picture         =   "writer.frx":10F6
  330.       Style           =   1  'Grafisch
  331.       TabIndex        =   2
  332.       Top             =   2040
  333.       Width           =   375
  334.    End
  335.    Begin RichTextLib.RichTextBox RichTextBox1 
  336.       Height          =   6975
  337.       Left            =   0
  338.       TabIndex        =   0
  339.       Top             =   3120
  340.       Width           =   11055
  341.       _ExtentX        =   19500
  342.       _ExtentY        =   12303
  343.       _Version        =   393217
  344.       Enabled         =   -1  'True
  345.       ScrollBars      =   2
  346.       TextRTF         =   $"writer.frx":1449
  347.    End
  348.    Begin MSComctlLib.StatusBar StatusBar1 
  349.       Align           =   2  'Unten ausrichten
  350.       Height          =   300
  351.       Left            =   0
  352.       TabIndex        =   1
  353.       Top             =   10110
  354.       Width           =   10995
  355.       _ExtentX        =   19394
  356.       _ExtentY        =   529
  357.       _Version        =   393216
  358.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  359.          NumPanels       =   3
  360.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  361.             Style           =   5
  362.             TextSave        =   "21:00"
  363.          EndProperty
  364.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  365.             Style           =   6
  366.             TextSave        =   "09.10.99"
  367.          EndProperty
  368.          BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  369.             Style           =   2
  370.             Enabled         =   0   'False
  371.             TextSave        =   "NUM"
  372.          EndProperty
  373.       EndProperty
  374.    End
  375.    Begin VB.Frame Frame1 
  376.       Height          =   1215
  377.       Left            =   0
  378.       TabIndex        =   23
  379.       Top             =   0
  380.       Width           =   2535
  381.    End
  382.    Begin VB.Frame Frame2 
  383.       Height          =   1215
  384.       Left            =   0
  385.       TabIndex        =   24
  386.       Top             =   1320
  387.       Width           =   2535
  388.    End
  389.    Begin VB.Frame Frame3 
  390.       Height          =   1215
  391.       Left            =   2880
  392.       TabIndex        =   25
  393.       Top             =   1320
  394.       Width           =   1335
  395.    End
  396.    Begin VB.Frame Frame4 
  397.       Height          =   735
  398.       Left            =   4560
  399.       TabIndex        =   26
  400.       Top             =   1800
  401.       Width           =   3015
  402.    End
  403.    Begin VB.Frame Frame5 
  404.       Height          =   1215
  405.       Left            =   7800
  406.       TabIndex        =   27
  407.       Top             =   1320
  408.       Width           =   1335
  409.    End
  410.    Begin VB.Frame Frame6 
  411.       Height          =   735
  412.       Left            =   9360
  413.       TabIndex        =   28
  414.       Top             =   1800
  415.       Width           =   1575
  416.    End
  417.    Begin VB.Label Label1 
  418.       BeginProperty Font 
  419.          Name            =   "Arial"
  420.          Size            =   12
  421.          Charset         =   0
  422.          Weight          =   700
  423.          Underline       =   0   'False
  424.          Italic          =   0   'False
  425.          Strikethrough   =   0   'False
  426.       EndProperty
  427.       Height          =   735
  428.       Left            =   3240
  429.       TabIndex        =   11
  430.       Top             =   240
  431.       Width           =   5535
  432.    End
  433. Attribute VB_Name = "frmWriter"
  434. Attribute VB_GlobalNameSpace = False
  435. Attribute VB_Creatable = False
  436. Attribute VB_PredeclaredId = True
  437. Attribute VB_Exposed = False
  438. Private Sub Command1_Click()
  439. RichTextBox1.SelBold = Not RichTextBox1.SelBold
  440. End Sub
  441. Private Sub Command10_Click()
  442.  Dim Answer
  443.     Answer = MsgBox(Prompt:="Do you really want to close this window?", _
  444.      Title:="Question", _
  445.      Buttons:=vbYesNo + vbQuestion)
  446.     If Answer = vbYes Then
  447.      Unload Me
  448.      mdimain.formcounter = mdimain.formcounter - 1
  449.     Else
  450.      cancel = True
  451.     End If
  452.     End Sub
  453. Private Sub Command11_Click()
  454. Private Sub Command12_Click()
  455. CommonDialog1.CancelError = True
  456. With CommonDialog1
  457.              .Filter = "Text (*.TXT)|*.TXT|"
  458.              .Filter = .Filter & "RTF (*.RTF)|*.RTF"
  459. On Error GoTo errhandler:
  460. CommonDialog1.Flags = cd10FNFileMustExist
  461. CommonDialog1.ShowOpen
  462. RichTextBox1.LoadFile CommonDialog1.filename, rtfText
  463. errhandler:
  464. Label1.Caption = CommonDialog1.filename
  465. Me.Caption = CommonDialog1.filename
  466. End With
  467. End Sub
  468. Private Sub Command14_Click()
  469. On Error GoTo errhandler
  470. CommonDialog1.CancelError = True
  471.     With CommonDialog1
  472.              .Filter = "Text (*.TXT)|*.TXT|"
  473.              .Filter = .Filter & "RTF (*.RTF)|*.RTF"
  474.            
  475.     CommonDialog1.ShowSave
  476.     If CommonDialog1.filename <> "" Then
  477.         Open CommonDialog1.filename For Output As #1
  478.         Print #1, RichTextBox1.Text
  479.         Close #1
  480.     End If
  481. errhandler:
  482. End With
  483. End Sub
  484. Private Sub Command15_Click()
  485. RichTextBox1.SelPrint (Printer.hDC)
  486. End Sub
  487. Private Sub Command16_Click()
  488. Clipboard.SetText RichTextBox1.SelText
  489. End Sub
  490. Private Sub Command17_Click()
  491. Clipboard.SetText RichTextBox1.SelText
  492. RichTextBox1.SelText = ""
  493. End Sub
  494. Private Sub Command18_Click()
  495. RichTextBox1.SelText = Clipboard.GetText
  496. End Sub
  497. Private Sub Command19_Click()
  498. Wrap$ = Chr$(13) & Chr$(10)
  499.     RichTextBox1.Text = Date & Wrap$ & RichTextBox1.Text
  500. End Sub
  501. Private Sub Command2_Click()
  502. RichTextBox1.SelText = LCase(RichTextBox1.SelText)
  503. End Sub
  504. Private Sub Command21_Click()
  505.  Dim SearchStr As String
  506.     Dim FoundPos As Integer
  507.     SearchStr = InputBox("Insert a word", "Find")
  508.     If SearchStr <> "" Then
  509.         
  510.         FoundPos = RichTextBox1.Find(SearchStr, , , _
  511.             rtfWholeWord)
  512.         
  513.         If FoundPos <> -1 Then
  514.         
  515.             RichTextBox1.Span " ", True, True
  516.         Else
  517.             MsgBox "Couldn't find the word", , "Suchen"
  518.         End If
  519.     End If
  520. End Sub
  521. Private Sub Command20_Click()
  522. Wrap$ = Chr$(13) & Chr$(10)
  523.     RichTextBox1.Text = Time & Wrap$ & RichTextBox1.Text
  524. End Sub
  525. Private Sub Command3_Click()
  526. RichTextBox1.SelItalic = Not RichTextBox1.SelItalic
  527. End Sub
  528. Private Sub Command4_Click()
  529. RichTextBox1.SelStrikeThru = Not RichTextBox1.SelStrikeThru
  530. End Sub
  531. Private Sub Command5_Click()
  532. RichTextBox1.SelUnderline = Not RichTextBox1.SelUnderline
  533. End Sub
  534. Private Sub Command6_Click()
  535. RichTextBox1.SelText = UCase(RichTextBox1.SelText)
  536. End Sub
  537. Private Sub Command7_Click()
  538.     CommonDialog1.CancelError = True
  539.     On Error GoTo errhandler:
  540.     CommonDialog1.Flags = cdlCFEffects Or cdlCFBoth
  541.     CommonDialog1.ShowFont
  542.     RichTextBox1.SelFontName = CommonDialog1.FontName
  543.     RichTextBox1.SelFontSize = CommonDialog1.FontSize
  544.     RichTextBox1.SelColor = CommonDialog1.Color
  545.     RichTextBox1.SelBold = CommonDialog1.FontBold
  546.     RichTextBox1.SelItalic = CommonDialog1.FontItalic
  547.     RichTextBox1.SelUnderline = CommonDialog1.FontUnderline
  548.     RichTextBox1.SelStrikeThru = CommonDialog1.FontStrikethru
  549. errhandler:
  550. End Sub
  551. Private Sub Command8_Click()
  552. CommonDialog1.CancelError = True
  553. On Error GoTo errhandler:
  554. CommonDialog1.ShowColor
  555. RichTextBox1.SelColor = CommonDialog1.Color
  556. errhandler:
  557. End Sub
  558. Private Sub Command9_Click()
  559. Label1.Caption = ""
  560. RichTextBox1.Text = ""
  561. End Sub
  562. Private Sub Form_Load()
  563. Slider1.Left = RichTextBox1.Left
  564. Slider1.Width = RichTextBox1.Width
  565. Slider1.Max = RichTextBox1.Width
  566. Slider1.TickFrequency = Slider1.Max * 0.1
  567. Slider1.LargeChange = Slider1.Max * 0.1
  568. Slider1.SmallChange = Slider1.Max * 0.01
  569. End Sub
  570. Private Sub Form_QueryUnload(cancel As Integer, UnloadMode As Integer)
  571.     Dim Answer
  572.     Answer = MsgBox(Prompt:="Do you really want to close this window?", _
  573.      Title:="Question", _
  574.      Buttons:=vbYesNo + vbQuestion)
  575.     If Answer = vbYes Then
  576.      Unload Me
  577.      mdimain.formcounter = mdimain.formcounter - 1
  578.     Else
  579.      cancel = True
  580.     End If
  581. End Sub
  582.